<template>
  <div id='cartList' class='cartList'>
    <scroll class="content" ref="scroller" :pull-up-load="true">
      <cart-list-item v-for="(item,index) in cartList" :key="index" :cartItem='item' />
    </scroll>
  </div>
</template>
<script>
  import CartListItem from './cartListItem.vue'
  import Scroll from '../../../components/common/scroll/scroll.vue'
  import {
    mapGetters
  } from 'vuex'
  export default {

    name: 'cartList',
    props: { // 父辈向子辈传参
    },
    components: { // 组件的引用
      CartListItem,
      Scroll
    },
    data() {
      return {

      }
    },
    methods: { // 方法

    },
    computed: { // 计算属性
      ...mapGetters(['cartList'])
    },
    activated() {
      this.$refs.scroller.refresh()
    },
    created() { // 实例被创建之后执行代码

    },
    mounted() { // 页面进入时加载内容

    },
    watch: { // 监测变化

    }
  }

</script>
<style scoped>
  .cartList {
    height: calc(100% - 44px - 49px - 40px);
    overflow: hidden;
  }

  .content {
    height: 100%;
  }

</style>
